<template>
	<view class="text-center" :class="{ 'full-page': full }">
		<image class="img" :style="`margin-top: ${top};`" :src="`/static/images/empty/${img}.png`" mode="widthFix"></image>
		<view class="text">{{text}}</view>
	</view>
</template>

<script>
	export default {
		name:"empty",
		props: {
			text: {
				type: String,
				default() {
					return '暂无数据~'
				}
			},
			top: {
				// 图片距离顶部距离
				type: String,
				default() {
					return '300rpx'
				}
			},
			img: {
				type: String,
				default() {
					return 'empty'
				}
			},
			// 是否占满屏幕
			full: {
				type: Boolean,
				default() {
					return false
				}
			}
		},
		data() {
			return {
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.img {
		vertical-align: top;
		width: 420rpx;
	}
	.text {
		padding: 17rpx 100rpx;
		color: #999999;
		font-size: 26rpx;
	}
	.full-page {
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		background-color: #fff;
	}
</style>
